<!--
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

Copyright (c) 2023-present Kaleidos INC
-->

<ng-container *transloco="let t; read: 'auth'">
  <tg-title [title]="t('login.login')"></tg-title>
  <main class="auth">
    <tg-auth-forest>
      <div class="auth-wrapper">
        <img
          class="taiga-logo"
          role="presentation"
          width="56"
          height="56"
          ngSrc="/assets/images/LogoTaiga.svg"
          alt="" />
        <h1 class="auth-title">{{ t('login.title') }}</h1>
        <tg-social-login *ngIf="displaySocialNetworks"></tg-social-login>
        <ng-container *ngIf="queryParams$ | async as queryParams">
          <tg-login
            *ngIf="
              !queryParams.availableLogins ||
              queryParams.availableLogins.includes('password')
            "
            [projectInvitationToken]="queryParams.projectInvitationToken"
            [workspaceInvitationToken]="queryParams.workspaceInvitationToken"
            [acceptProjectInvitation]="queryParams.acceptProjectInvitation"
            [acceptWorkspaceInvitation]="queryParams.acceptWorkspaceInvitation"
            [email]="queryParams.email"
            [invitationStatus]="queryParams.invitationStatus"
            [nextProjectId]="queryParams.nextProjectId"
            [nextWorkspaceId]="queryParams.nextWorkspaceId"
            [next]="queryParams.next"></tg-login>
        </ng-container>
      </div>
    </tg-auth-forest>
  </main>
  <footer class="auth-footer">
    <p class="login-link">
      <span>{{ t('login.not_registered_yet') }} </span>
      <a [routerLink]="['/signup']">{{ t('login.create_free_account') }}</a>
    </p>
  </footer>
</ng-container>
